package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.system.domain.SUserOperateRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 员工记录Mapper接口
 * 
 * @author ruoyi
 * @date 2023-07-05
 */
public interface SUserOperateRecordMapper extends BaseMapper<SUserOperateRecord>
{

    /**
     * 获取员工操作记录列表
     * @param queryWrapper 查询条件
     * @return 结果集
     */
    @Select("SELECT uor.*, sd.device_name, s.substation_name,pd.protect_device_model,u.nick_name FROM s_user_operate_record  uor " +
            "LEFT JOIN s_substation_device sd on sd.id = uor.device_id " +
            "LEFT JOIN s_substation s on s.id = sd.substation_id " +
            "LEFT JOIN s_protect_device pd on pd.id = uor.protect_device_id " +
            "LEFT JOIN sys_user u on u.user_id = uor.user_id  ${ew.customSqlSegment}")
    List<SUserOperateRecord> getList(@Param(Constants.WRAPPER) Wrapper<SUserOperateRecord> queryWrapper);
}
